<!-- 列表排序 -->
<template>
    <div class="kkxcxzrere pr">
      <n-input-number 
      v-model:value="row[keyName]" 
      placeholder="" size="medium" 
      @blur="xcxcrert"
     />
    </div>
  </template>
  <script lang='ts' setup>
  import { dxget,dxpost } from "../../util/index";
  const props = defineProps({
    row: { type: Object },
    type: { type: Number },
    api: { type: String },
    keyName: { type: String },
  });
  const emit = defineEmits(["callBack"]);
  const paissrtrt = (data) => {
    console.log(data);
    // paixu(data)
  }
  const xcxcrert = (data)=>{
    paixu(props.row[props.keyName])
  }
  const paixu = async (cs) => {
    const obj ={
      id: props.row.id
    }
    obj[props.keyName] = cs
    const { errno, data }: any = await dxpost(props.api,obj ,'put');
    if (errno == 0) {
      window.$message.success(data);
    } else {
      console.error(data);
    }
    emit("callBack");
  };
  </script>
  <style scoped>
  .dsfdsrre i {
    color: #999;
  }
  
  .dsfdsrre i:hover {
    color: #333;
  }
  </style>